home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Supervisor's Toolkit
/
Network Supervisor's Toolkit.iso
/
tools
/
lu62
/
proc
/
fsendat.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-10
|
2KB
|
79 lines
/*
* CopyRight 1995. Nicholas Poljakov all rights reserved.
*/
#include <malloc.h>
#include <stdio.h>
#include <dos.h>
#include <sendat.h>
#include <state1.h>
send_data (tp_id,
conv_id,
p_data,
map_type,
map_name,
length,
p_rc,
p_rts)
unsigned char tp_id[8];
unsigned long conv_id;
char far *p_data;
unsigned int length ;
unsigned char * p_rts ;
int map_type; /* not used */
int map_name; /* not used */
struct rc {
unsigned int prim ;
unsigned long sec ; } *p_rc;
{
struct send_data *ptr;
char _near *dp1;
char _near *dp2;
int l;
l = sizeof(struct send_data);
if ((ptr = (char *)calloc(1,l)) == NULL)
{
p_rc->prim = PORT_BUSY; /* ¡ÑΓ ñ«ßΓπ»¡«⌐ »á¼∩Γ¿ */
p_rc->sec = 0x00;
return(0);
}
ptr->code=Send_data; /* kod primitiv */
ptr->e_cd=0x0000; /* ex */
memcpy (ptr->tp_id,tp_id,8);
ptr->conv_id = conv_id;
ptr->data_addr=p_data ;
ptr->data_lt=length ;
/*
inregs.x.dx = FP_OFF(ptr);
segregs.ds = FP_SEG(ptr);
inregs.x.ax = ptr->code;
int86x(0x68,&inregs,&outregs,&segregs);
*/
dp1 = FP_OFF( ptr );
dp2 = FP_SEG( ptr );
_asm
{
push ds
mov dx, word ptr dp1[0]
mov ax, word ptr dp2[0]
mov ds, ax
mov ax, Send_data
int 68h
pop ds
}
*p_rts=ptr->rts;
p_rc->prim = ptr->prim_rc;
p_rc->sec = ptr->sec_rc;
free(ptr);
return(0);
}